package com.nbjtjc.safe.api.safe;

import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.safe.SafeDangerInspectTask;
import com.nbjtjc.safe.model.safe.SafeDangerInspectTaskRecord;
import com.nbjtjc.safe.service.safe.SafeDangerInspectTaskRecordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/safe/taskRecord")
@CrossOrigin("*")
public class SafeDangerInspectTaskRecordController {

    @Autowired
    private SafeDangerInspectTaskRecordServiceImpl taskRecordService;

    @GetMapping("/getTaskInfo")
    public Result getTaskInfo(){
        return taskRecordService.getTaskRecordInfo();
    }

    @PostMapping("/add")
    public Result add(@RequestBody SafeDangerInspectTaskRecord taskRecord){
        return taskRecordService.add(taskRecord);
    }

    @PostMapping("/search")
    public Result search(@RequestBody SafeDangerInspectTaskRecord taskRecord){
        return taskRecordService.search(taskRecord);
    }

    @PostMapping("/doTask")
    public Result doTask(@RequestBody SafeDangerInspectTaskRecord taskRecord){
        return taskRecordService.doTask(taskRecord);
    }

}
